<template>
	<view class="page" :style="{minHeight:$height()}">
		<view class="item" v-for="(item,index) in list" :key="index">
			<view class="topBox">
				<view class="txt">
					{{item.contractName}}
				</view>
				<view class="look" @click="openFile(item.url)">
					查看
				</view>
			</view>
			<view class="buttomBox">
				<view class="tateBox">
					<view class="tateTxt" style="margin-right: 20rpx;">
						签署日期:
					</view>
					<view class="tate">
						{{item.createDate}}
					</view>
				</view>
				<view class="dowload" @click="openFile(item.url)">
					下载
				</view>
			</view>
		</view>
		
		<image v-if="list.length == 0" src="@/static/image/empty.png" mode="widthFix" class="is-empty"></image>
		
	</view>
</template>

<script>
	export default{
		data(){
			return{
				list:[],
				userinfo:{}
			}
		},
		onShow() {
			this.getUser()
		},
		methods:{
			getUser(){
				this.$axios.request(this.$api.getUser, "GET").then((val) => {
					this.list = val.data.userContractList
					this.userinfo = val.data
				})
			},
			openFile(url){
				this.$utils.downLoad(this.$axios.interfaceUrl()+url)
			}
		}
	}
</script>

<style>
	.page {
		width: 100%;
		height: 100%;
		background-color: #F0F2F5;
		overflow-y: hidden;
	}
	.item {
		display: flex;
		justify-content: space-between;
		flex-direction: column;
		width: 100%;
		height: 148rpx;
		background-color: #FFFFFF;
		padding: 16rpx 35rpx;
		margin-top: 16rpx;
	}
	.topBox ,
	.buttomBox {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
	}
	.txt {
		height: 50rpx;
		font-size: 36rpx;
		font-family: "PingFang SC";
		font-weight: 600;
		line-height: 50rpx;
		color: #333333;
		opacity: 1;
	}
	.look {
		height: 40rpx;
		background-color: #2E6ADF;
		opacity: 1;
		border-radius: 4rpx;
		font-size: 24rpx;
		font-family: "PingFang SC";
		font-weight: 300;
		line-height: 40rpx;
		padding: 0 26rpx;
		color: #FFFFFF;
		opacity: 1;
	}
	.dowload {
		height: 40rpx;
		border-radius: 4rpx;
		font-size: 24rpx;
		font-family: "PingFang SC";
		font-weight: 300;
		line-height: 40rpx;
		padding: 0 26rpx;
		color: #2E6ADF;
		opacity: 1;
		background-color: #FFFFFF;
		border: 1rpx solid #2E6ADF;
		border-radius: 4rpx;
	}
	.tateBox {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		height: 100%;
		font-size: 36rpx;
		font-family: "PingFang SC";
		font-weight: 300;
		color: #222222;
		opacity: 1;
	}
	.more {
		font-size: 24rpx;
		font-family: "PingFang SC";
		text-align: center;
		font-weight: 300;
		color: #BBBBBB;
		opacity: 1;
		margin: 24rpx auto 116rpx;
	}
</style>
